<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/jquery.js"></script>

</head>
<body>
<div id="app">
    <form id="formAdd">
        产品名称：<input type="text" name="name"><br>
        产品编码：<input type="text" name="code"><br>
        <input type="button" value="保存" @click="add()" >
        <input type="reset" value="重置">
    </form>
</div>

<script>
    var vue = new Vue({
        el: '#app',
        methods: {
            add: function () {
                $.post('http://localhost:8080/brand/add', $('#formAdd').serialize(), function (data) {
                    if(data.code==200){
                        location.href="index.html";
                    }
                });
            }
        }
    })
</script>
</body>
</html>